﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

// 直线查找

namespace Vision.src
{

    // 定义事件参数
    public class LineFindEventArgs : EventArgs
    {
        public float StartPointX { get; }
        public float StartPointY { get; }
        public float EndPointX { get; }
        public float EndPointY { get; }
        public float LineAngle { get; }

        public LineFindEventArgs(float startpointX, float startpointY, float endpointX, float endpointY, float lineangle)
        {
            StartPointX = startpointX;
            StartPointY = startpointY;
            EndPointX = endpointX;
            EndPointY = endpointY;
            LineAngle = lineangle;
        }
    }

    // 定义委托
    public delegate void LineFindEventHandler(LineFind linefind, LineFindEventArgs e);

    public class LineFind
    {
        private LineFindEventHandler lineFindEventHandler;

        public event LineFindEventHandler Order
        {
            add
            {
                this.lineFindEventHandler += value;
            }
            remove
            {
                this.lineFindEventHandler -= value;
            }
        }

        public void ReturnResult(LineFindEventArgs e)
        {
            this.lineFindEventHandler?.Invoke(this, e);
        }
    }
}
